<template>
  <div>测试组件</div>
</template>

<script>
// import axios from 'axios'
// import instance from '@/utils/request'
// import mockInstance from '@/utils/mockRequest'
import { reqCategoryList, reqSwiperList, reqFloorList } from '@/api/home'

export default {
  name: 'VTest',
  mounted() {
    this.getData()

    this.getMockData()
  },
  methods: {
    // 请求 Mock 模拟的数据
    async getMockData() {
      const res1 = await reqSwiperList()
      const res2 = await reqFloorList()

      // const res1 = await axios.get('https://www.test.com/swiper')
      // const res2 = await axios.get('https://www.test.com/floor')
      // if (res1.data.code === 200) {
      //   console.log(res1)
      // }
      console.log(res1)
      console.log(res2)
    },

    async getData() {
      // const res = await axios.get('/api/product/getBaseCategoryList')
      // const res1 = await instance
      //   .get('/api/product/getBaseCategoryList')
      //   .then((res) => console.log(res))
      //   .catch((err) => console.log(err.message))

      // const res1 = await instance.get('/api/product/getBaseCategoryList')

      // const res2 = await instance.get('/api/product/getBaseCategoryList')

      const res1 = await reqCategoryList()

      // const res2 = await reqList(1, 10)

      console.log(res1)

      // console.log(res2)
    }
  }
}
</script>

<style lang="less" scoped></style>
